package com.game;


import android.content.Context;
import android.graphics.Canvas;
import android.view.View;

public class GameView extends View {
	BackgroundMirror backgroundMirror;
	BallManager ballManager;
	private boolean running;
	
	public GameView(Context context) {
		super(context);
		setFocusable(true); //necessary for getting the touch events
		
		// Create elements
		backgroundMirror = new BackgroundMirror(context, R.drawable.background);
		ballManager = new BallManager(context, 5);
		
		running = true;
		
	}
	
	@Override protected void onDraw(Canvas canvas) {
        //canvas.drawColor(0xFF000000);     //if you want another background color    
		backgroundMirror.onDraw(canvas);
		ballManager.onDraw(canvas);
        
    }
	
	public void Update()
	{
		while(running)
		{
			ballManager.Update();
		}
		
	}

	// getIntrinsicWidth
}
